import request from '@/utils/request'

export function listLedger(query) {
    return request({
        url: '/resource/sample/list',
        method: 'get',
        params: query
    })
}
// 台账查询接口
export function newListLedger(query) {
    return request({
        url: '/resource/sample/ledger/list',
        method: 'get',
        params: query
    })
}
//详情弹窗查询所有标准物质列表(下拉框)
export function getBzwzList() {
    return request({
        url: '/resource/bzwz/out/outList',
        method: 'get',
    })
}
//选择标准物质后级联选择唯一编号
export function getRowForm(query) {
    return request({
        url: '/resource/bzwz/out',
        method: 'get',
        params: query
    })
}

// 期间核查的表单和表格接口
export function FormLedger(sampleId) {
    return request({
        url: '/resource/sample/' + sampleId,
        method: 'get',
    })
}

export function checkListLedger(query) {
    return request({
        url: 'resource/sample/check/list',
        method: 'get',
        params: query
    })
}

export function getTpCodeList(query) {
    return request({
        url: '/resource/instrument/instrumentList',
        method: 'get',
        params: query
    })
}

export function getTpType(instrumentId) {
    return request({
        url: '/resource/instrument/' + instrumentId,
        method: 'get',
    })
}

export function sampleList(query) {
    return request({
        url: '/resource/sample/jcxm/list',
        method: 'get',
        params: query
    })
}

export function delSampleList(sampleIds) {
    return request({
        url: '/resource/sample/delete/' + sampleIds,
        method: 'delete',
    })
}

export function zzypViewForm(sampleId) {
    return request({
        url: '/resource/sample/' + sampleId,
        method: 'get',
    })
}

export function addSample(query) {
    return request({
        url: '/resource/sample',
        method: 'post',
        data: query
    })
}

export function bzwzOut(query) {
    return request({
        url: '/resource/sample/out',
        method: 'put',
        data: query
    })
}

export function batchBzwzOut(query) {
    return request({
        url: '/resource/sample/out',
        method: 'post',
        data: query
    })
}

export function getJcxmList(query) {
    return request({
        url: '/resource/bzwz/jcxm/bucketList',
        method: 'get',
        params: query
    })
}

export function getSampleOutList(query) {
    return request({
        url: '/resource/sample/out/list',
        method: 'get',
        params: query
    })
}

// 超期处置列表查询
export function listDelayHandle(query) {
    return request({
        url: '/resource/sample/delayHandle/list',
        method: 'get',
        params: query
    })
}

// 处置按钮查询
export function handleForm(sampleIds) {
    return request({
        url: '/resource/sample/handle/batch/' + sampleIds,
        method: 'get',
    })
}

// 超期处置保存
export function saveBatchHandle(query) {
    return request({
        url: '/resource/sample/handle/batch',
        method: 'post',
        data: query
    })
}

// 处置记录接口
export function listHandle(query) {
    return request({
        url: '/resource/sample/handle/list',
        method: 'get',
        params: query
    })
}

// 删除期间核查记录
export function delLedger(chackIds) {
    return request({
        url: 'resource/sample/check/delete/' + chackIds,
        method: 'delete',
    })
}
